package com.hospital.service.sample.model.param;

import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hospital.service.sample.entity.SamInfoBase;
import com.hospital.service.sample.entity.help.SamInfoBaseHelp;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import lombok.experimental.Accessors;
import enhance.plus.util.MybatisPlusUtil;

import java.io.Serializable;
import java.util.Date;
import java.util.Map;

/**
 * 实验样本基本表 新增参数
 *
 * @author lfb
 * @created 2020-10-10 14:26:39
 */
@Data
@ToString
@Accessors(chain = true)
@ApiModel(value="SamInfoBase[实验样本基本表]入参")
public class SamInfoBaseQueryForOneRowParam implements Serializable{

    /**
    * ID
    */
    @ApiModelProperty(value = "ID", required = false , example = "")
    private String id;

    /**
     * 样本检索编号
     */
    @ApiModelProperty(value = "样本检索编号", required = false , example = "")
    private String samplesNumber;

    /**
     * 样本名称
     */
    @ApiModelProperty(value = "样本名称", required = false , example = "")
    private String samplesName;

    /**
     * 概述
     */
    @ApiModelProperty(value = "概述", required = false , example = "")
    private String summary;

    /**
     * 组织/细胞部位
     */
    @ApiModelProperty(value = "组织/细胞部位", required = false , example = "")
    private String position;

    /**
     * 样本存放位置
     */
    @ApiModelProperty(value = "样本存放位置", required = false , example = "")
    private String samplesStorageLocation;

    /**
     * 分组检索编号**[外键]
     */
    @ApiModelProperty(value = "分组检索编号**[外键]", required = false , example = "")
    private String groupNumber;

    /**
     * 把非 null 的值 转换成一个 查询条件
     * @return
     */
    public QueryWrapper<SamInfoBase> convertParamToQueryWapper(){
        QueryWrapper<SamInfoBase> query = SamInfoBaseHelp.createQuery();
        Map<String, Object> result =  MybatisPlusUtil.convertParamToMap(this, SamInfoBase.class);
        query.allEq(result);
        return query;
    }
}
